<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>控制台 - 后台管理系统</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<!-- <link href="/ddEle/Public/assets/css/bootstrap.min.css" rel="stylesheet" /> -->

		<link href="/ddEle/Public/assets/css/bootstrap.min.css" rel="stylesheet" /> 
		<link rel="stylesheet" href="/ddEle/Public/assets/css/font-awesome.min.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="/ddEle/Public/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- fonts -->
		<!--
		<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />
		-->
		<!-- ace styles -->

		<link rel="stylesheet" href="/ddEle/Public/assets/css/ace.min.css" />
		<link rel="stylesheet" href="/ddEle/Public/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="/ddEle/Public/assets/css/ace-skins.min.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/ddEle/Public/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="/ddEle/Public/assets/js/ace-extra.min.js"></script>
		<link rel="stylesheet" href="/ddEle/Public/admin/css/pintuer.css">
    	<link rel="stylesheet" href="/ddEle/Public/admin/css/admin.css">
    	<script src="/ddEle/Public/admin/js/jquery.js"></script>
    	<script src="/ddEle/Public/admin/js/jquery-2.1.4.js"></script> 
		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
		
	<style>
		.add-goods-step {
			    font-size: 0;
			    background-color: #FFF;
			    *word-spacing: -1px;
			    margin: 0 0 20px 20px;
			    overflow: hidden;
		}
	
		.add-goods-step li {
		    color: #CCC;
		    vertical-align: top;
		    letter-spacing: normal;
		    word-spacing: normal;
		    display: inline-block;
		    width: 100%;
		    height: 50px;
		    position: relative;
		    z-index: 1;
		    float: left;
		}
		.add-goods-step li{
			width:262px;
			float:left;
		}
		.add-goods-step li.current, .style-seller .add-goods-step li.current h2 {
   			 color: #1ABC9C !important;
		}
		.goods-spec .simple-form-field.spec-title-box {
		    padding-top: 0;
		    padding-bottom: 5px;
		    background: #22BAA0;
		    border: 1px solid #22BAA0;
		    border-bottom: 0px;
		    color: #fff;
		    border-bottom: 0px;
		    font-weight: 700;
		}
		body, td, input, textarea, select, button {
    color: #666;
    font-size: 12px;
    font-family: "Microsoft Yahei", "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
}

.table *{
    font-size: 12px;
}
.table th{
	width:34px;
}
table thead{
	color: #ffffff;
	background: #48CFAE;
	padding: 10px 5px;
	cursor: default;
}
table tr td{
	text-align:center;
}

table tbody{
	background:white;
}
.btn-file {  /*  上传按钮*/
    position: relative;
    overflow: hidden;
}

.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity = 0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}
	</style>



		<!--[if lt IE 9]>
		<script src="/ddEle/Public/assets/js/html5shiv.js"></script>
		<script src="/ddEle/Public/assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body>
<div class="header bg-main" style="margin:0">
  <div class="logo margin-big-left fadein-top">
    <h1><img src="/ddEle/Public/admin/images/y.jpg" class="radius-circle rotate-hover" height="50" alt="" />后台管理中心</h1>
  </div>
  <div class="head-l"><a class="button button-little bg-green" href="" target="_blank"><span class="icon-home"></span> 前台首页</a> &nbsp;&nbsp;<a href="##" class="button button-little bg-blue"><span class="icon-wrench"></span> 清除缓存</a> &nbsp;&nbsp;<a class="button button-little bg-red" href="<?php echo U('Login/logout');?>"><span class="icon-power-off"></span> 退出登录</a> </div>
</div>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<div class="sidebar" id="sidebar">
					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
					</script>

					<div class="sidebar-shortcuts" id="sidebar-shortcuts">
						<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
							<button class="btn btn-success">
								<i class="icon-signal"></i>
							</button>

							<button class="btn btn-info">
								<i class="icon-pencil"></i>
							</button>

							<button class="btn btn-warning">
								<i class="icon-group"></i>
							</button>

							<button class="btn btn-danger">
								<i class="icon-cogs"></i>
							</button>
						</div>

						<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
							<span class="btn btn-success"></span>

							<span class="btn btn-info"></span>

							<span class="btn btn-warning"></span>

							<span class="btn btn-danger"></span>
						</div>
					</div><!-- #sidebar-shortcuts -->

					<ul class="nav nav-list">
						<li <?php if((CONTROLLER_NAME) == "Index"): ?>class="active"<?php endif; ?>>
							<a href="<?php echo U('Index/index');?>">
								<i class="icon-dashboard"></i>
								<span class="menu-text"> 控制台 </span>
							</a>
						</li>
						
						<li>
							<?php if($_SESSION['node']['user'] == '1' ): ?><a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 用户管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "User"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'User') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
								<?php if($_SESSION['node']['user_index'] == '1' ): ?><a href="<?php echo U('User/index');?>">
										<i class="icon-double-angle-right"></i>
										用户列表
									</a><?php endif; ?>
								</li>
								<!-- 第一次操作结束 -->
							</ul><?php endif; ?>
						</li>
							

						<li>
							<?php if($_SESSION['node']['role'] == '1' ): ?><a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 角色管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Role"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Role') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
								<?php if($_SESSION['node']['role_index'] == '1' ): ?><a href="<?php echo U('Role/index');?>">
										<i class="icon-double-angle-right"></i>
										角色列表
									</a><?php endif; ?>
								</li>
							</ul><?php endif; ?>
						</li>
						<!-- 第二次修改结束 -->
						<li>
							<?php if($_SESSION['node']['node'] == '1' ): ?><a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 节点管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Node"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Node') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
								<?php if($_SESSION['node']['node_index'] == '1' ): ?><a href="<?php echo U('Node/index');?>">
										<i class="icon-double-angle-right"></i>
										节点列表
									</a><?php endif; ?>
								</li>
							</ul><?php endif; ?>
						</li>
						<!-- 第三次修改完成 -->
						<!-- 第四次修改开始 -->
						<li>
							<?php if($_SESSION['node']['category'] == '1' ): ?><a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 分类管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Category"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Category') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
								<?php if($_SESSION['node']['category_index'] == '1' ): ?><a href="<?php echo U('Category/index');?>">
										<i class="icon-double-angle-right"></i>
										分类列表
									</a><?php endif; ?>
								</li>

								<li <?php if((CONTROLLER_NAME== 'Category') and (ACTION_NAME== 'treeList')): ?>class="active"<?php endif; ?>>
								<?php if($_SESSION['node']['category_treeList'] == '1' ): ?><a href="<?php echo U('Category/treeList');?>">
										<i class="icon-double-angle-right"></i>
										分类树列表
									</a><?php endif; ?>
								</li>
							</ul><?php endif; ?>
						</li>
						
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 链接管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Link"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Link') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Link/index');?>">
										<i class="icon-double-angle-right"></i>
										链接列表
									</a>
								</li>
								<li <?php if((CONTROLLER_NAME== 'Link') and (ACTION_NAME== 'add')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Link/add');?>"  >
										<i class="icon-double-angle-right icon-plus"></i>
										链接添加
									</a>
								</li>
							</ul>
						</li>
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 商城配置 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "WebConfig"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'WebConfig') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('WebConfig/index');?>">
										<i class="icon-double-angle-right"></i>
										配置列表
									</a>
								</li>
								<li <?php if((CONTROLLER_NAME== 'WebConfig') and (ACTION_NAME== 'add')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('WebConfig/add');?>"  >
										<i class="icon-double-angle-right icon-plus"></i>
										配置添加
									</a>
								</li>
							</ul>
						</li>

						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 订单管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Order"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Order') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Order/index');?>">
										<i class="icon-double-angle-right"></i>
										订单列表
									</a>
								</li>
							</ul>
						</li>
						
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 商品管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Order"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Goods') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Goods/index');?>">
										<i class="icon-double-angle-right"></i>
										商品列表
									</a>
								</li>
								<li <?php if((CONTROLLER_NAME== 'Goods') and (ACTION_NAME== 'add')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Goods/addIndex');?>">
										<i class="icon-double-angle-right"></i>
										商品添加
									</a>
								</li>
								<li <?php if((CONTROLLER_NAME== 'brand') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Brand/index');?>">
										<i class="icon-double-angle-right"></i>
										品牌管理
									</a>
								</li>
								<li <?php if((CONTROLLER_NAME== 'property') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('property/index');?>">
										<i class="icon-double-angle-right"></i>
										属性管理
									</a>
								</li>
							</ul>
						</li>

						<!--个性化设置重复-->
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 个性化设置管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "config"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'config') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Config/index');?>">
										<i class="icon-double-angle-right"></i>
										登录注册主题
									</a>
								</li>
							</ul>
						</li>


						<!--评论管理-->
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 评论管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == "Comment"): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Comment') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('Comment/indexshop');?>">
										<i class="icon-double-angle-right"></i>
										评论列表
									</a>
								</li>								
							</ul>
						</li>


						<!--广告管理-->
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="icon-list"></i>
								<span class="menu-text"> 广告管理 </span>

								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu" <?php if((CONTROLLER_NAME) == ""): ?>style="display:block"<?php endif; ?>>
								<li <?php if((CONTROLLER_NAME== 'Ad') and (ACTION_NAME== 'index')): ?>class="active"<?php endif; ?>>
									<a href="<?php echo U('ad/index');?>">
										<i class="icon-double-angle-right"></i>
										广告列表
									</a>
								</li>								
							</ul>
						</li>
					</ul><!-- /.nav-list -->

					<div class="sidebar-collapse" id="sidebar-collapse">
						<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
					</div>

					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
					</script>
				</div>

				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							
	<li>
		<i class="icon-home home-icon"></i>
		<a href="#">首页</a>
	</li>
	<li class="active"配置管理</li>

						</ul><!-- .breadcrumb -->

						<div class="nav-search" id="nav-search">
							<form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="keyword" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
									<input class="btn btn-primary btn-xs" value="搜索" style="border-radius:3px; height:28px; margin-top:-4px; padding-right:24px;" type="button" onclick="getPage(1)">
								</span>
							</form>
						</div><!-- #nav-search -->
					</div>

					<div class="page-content">
						<div class="page-header">
							
	<ul class="add-goods-step">
	<li id="step_2" class="current">
		<i class="glyphicon glyphicon-edit"></i>
		<!-- <img src="/ddEle/Public/Home/img/setup1.jpg" alt=""> -->
		<h6>STEP.1</h6>
		<h2>填写商品详情</h2>
		<i class="fa fa-angle-right"></i>
	</li>
	<li id="step_3">
		<i class="fa fa-image step"></i>
		<h6>STEP.2</h6>
		<h2>上传商品图片</h2>
		<i class="fa fa-angle-right"></i>
	</li>
	<li id="step_4">
		<i class="fa fa-check-square-o step"></i>
		<h6>STEP.3</h6>
		<h2>商品发布成功</h2>
	</li>
</ul>

						</div><!-- /.page-header -->
						
	<div class="col-md-7 col-md-push-2" style="margin-bottom:80px">
		<form class="form-horizontal" role="form" action="<?php echo U('Goods/addGoods');?>" method="post" enctype="multipart/form-data">
		<div class="form-group" style="height:30px">
		    <label for="inputEmail3" class="col-sm-2 control-label"><span class="text-danger ng-binding">*</span>选择商品分类</label>
		    <div class="col-sm-10">
		      	 <select name="cid" id="" class="form-control catSelect">
					<?php if(is_array($arr)): $i = 0; $__LIST__ = $arr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$firstCat): $mod = ($i % 2 );++$i;?><option <?php if(!empty($firstCat['child'])): ?>disabled<?php endif; ?> value="<?php echo ($firstCat['id']); ?>">
					       <?php echo $firstCat['html'].$firstCat['name'] ?>
						</option>		
						<?php if(is_array($firstCat['child'])): $i = 0; $__LIST__ = $firstCat['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$secCat): $mod = ($i % 2 );++$i;?><option <?php if(!empty($secCat['child'])): ?>disabled<?php endif; ?> value="<?php echo ($secCat['id']); ?>" >
							   <?php echo $secCat['html'].$secCat['name'] ?>
							</option>

							<?php if(is_array($secCat['child'])): $i = 0; $__LIST__ = $secCat['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$thdCat): $mod = ($i % 2 );++$i;?><option <?php if(!empty($thdCat['child'])): ?>disabled<?php endif; ?> value="<?php echo ($thdCat['id']); ?>" >
							   <?php echo $thdCat['html'].$thdCat['name'] ?>
							</option><?php endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; ?>	
				</select>
		    </div>
		  </div>
		  <div class="form-group">
		  	<!-- <div class="col-sm-1">
		  		 <label for="inputPassword3" class="col-md-12 control-label"></span>商品名称</label>
		  	</div> -->
		   <label for="inputEmail3" class="col-sm-2 control-label col-sm-pull-2"><span class="text-danger ng-binding">*</span>商品名</label>
		    <div class="col-sm-10 col-sm-pull-2" style="width:400px">
		      <input type="text" name="goodsname" class="form-control" id="goodsname" placeholder="填写商品名称">
		      <span class="text-danger error" style="display:none">商品名称不能为空</span>
		    </div>
		  </div>
		   <div class="form-group">
		    <label for="inputPassword1" class="col-sm-2 control-label">商品品牌</label>
		    <div class="col-sm-10">
		     	<select class="form-control focus state" id="inputPassword1" style="width:200px" name="brand">
			       <?php if(is_array($brandArr)): $i = 0; $__LIST__ = $brandArr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$brand): $mod = ($i % 2 );++$i;?><option value="<?php echo ($brand['id']); ?>"><?php echo ($brand['brandname']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
		    	</select>	 
		    </div>	
		  </div>

		  <!--属性大盒子-->
		  <div style="padding: 10px;background: rgba(93,178,255,.1);border: 1px solid #BCE8F1;min-width: 650px;">
		  		 <div class="form-group" style=" padding-top: 0;padding-bottom: 5px;background: #22BAA0;border: 1px solid #22BAA0;border-bottom: 0px;color: #fff;border-bottom: 0px;font-weight: 700;">
		      			<label for="inputPassword1" class="col-sm-2 control-label">属性选择</label>	
		      			<label for="inputPassword1" class="col-sm-2 control-label"><button class="btn btn-primary btn-xs addSku">填写具体信息</button></label>	  
		 		 </div>
			<img id="loading" src="/ddEle/Public/Home/img/loading3.gif" alt="" style="position:fixed;left:50%;top:60%;display:none">

			<div id="propertyChBox"><!--ajax变换部分-->
			  <!--属性1-->
			  
		 	</div><!--ajax变换部分-->

			<div id="skuTable"><!--sku表格变换部分-->
				
			</div>
		 			<!--商品主图上传-->
		  </div>
		  <div class="form-group" style="margin-top:20px">
		    <label for="inputPassword1" class="col-sm-2 control-label">商品主图上传</label>
		    <div class="col-sm-10" style="height:200px">
		    	 <a href="javascript:void(0)" class="highslide upload-thumb ">
					<img id="goods_image_tag" width="200px" height="200px" src="/ddEle/Public/Home/img/1040015948-6_k_2.jpg" alt="" />
				</a>
				<div>
					<span class="btn btn-primary btn-file"> 选择图片
					 <span class="glyphicon glyphicon-picture" aria-hidden="true"></span>
					    <input type="file" name="info_photo" value="" id="info_photo" />
					 </span>
					 <label for="" class="text-danger" style="display:none">上传的必须是图片类型!</label>
				</div>
		    </div>	
		    </div>


			    <div class="goods-next text-center" style="margin-top:60px">
					
					<input id="btn_publish" value="下一步，上传商品图片" class="btn btn-success" type="submit">
					
					<!--不可点击状态的下一步-->
					<!--<button class="btn btn-default">下一步，上传商品图片</button>-->
				</div>
		</form>
	</div>
	


<!--隐藏的元素用于接受-->
<div class="col-md-12 cloned" style="display:none">
	<table id="sku_table" class="sku_table" style="display:_none">
							<thead>
								<tr>
									<th class="sku-th-index" style="width:80px;font-size:14px;word-break:break-all">库存</th>
									<th class="sku-th-index" style="width:80px;font-size:14px;word-break:break-all">价格</th>
									<th class="sku-th-index" style="width:80px;font-size:14px;word-break:break-all">是否上架</th>
									<th class="sku-th-index" style="width:80px;font-size:14px;word-break:break-all">操作</th>
								</tr>
						   </thead>
						   <tbody>
						   	    <tr>
						   	    	<td><input type="text" name="store"><label style="display:none" for="" class="text-danger error">库存必须是数字</label></td>
						   	    	<td><input type="text" name="price"><label style="display:none" for="" class="text-danger error">价格必须是数字</label></td>
						   	    	<td><input type="checkbox" checked="checked" name="status" value="1"></td>
						   	    	<td><span class="btn btn-xs btn-danger cancelBtn">取消</span></td>
						   	    </tr>
						   </tbody>
	</table>
</div>
			
<!--隐藏的元素用于-->


<!--用于显示图片的摸态框-->

<!--用于显示图片的摸态框-->


					</div><!-- /.page-content -->
				</div><!-- /.main-content -->

				<div class="ace-settings-container" id="ace-settings-container">
					<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
						<i class="icon-cog bigger-150"></i>
					</div>

					<div class="ace-settings-box" id="ace-settings-box">
						<div>
							<div class="pull-left">
								<select id="skin-colorpicker" class="hide">
									<option data-skin="default" value="#438EB9">#438EB9</option>
									<option data-skin="skin-1" value="#222A2D">#222A2D</option>
									<option data-skin="skin-2" value="#C6487E">#C6487E</option>
									<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
								</select>
							</div>
							<span>&nbsp; 选择皮肤</span>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
							<label class="lbl" for="ace-settings-navbar"> 固定导航条</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
							<label class="lbl" for="ace-settings-sidebar"> 固定滑动条</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs" />
							<label class="lbl" for="ace-settings-breadcrumbs">固定面包屑</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" />
							<label class="lbl" for="ace-settings-rtl">切换到左边</label>
						</div>

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
							<label class="lbl" for="ace-settings-add-container">
								切换窄屏
								<b></b>
							</label>
						</div>
					</div>
				</div><!-- /#ace-settings-container -->
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<!--
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
		-->
		<!-- <![endif]-->

		<!--[if IE]>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<![endif]-->

		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='/ddEle/Public/assets/js/jquery-2.0.3.min.js'>"+"<"+"script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='/ddEle/Public/assets/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
		</script>
		<script src="/ddEle/Public/assets/js/bootstrap.min.js"></script>
		<script src="/ddEle/Public/assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="/ddEle/Public/assets/js/excanvas.min.js"></script>
		<![endif]-->

		<script src="/ddEle/Public/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
		<script src="/ddEle/Public/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="/ddEle/Public/assets/js/jquery.slimscroll.min.js"></script>
		<script src="/ddEle/Public/assets/js/jquery.easy-pie-chart.min.js"></script>
		<script src="/ddEle/Public/assets/js/jquery.sparkline.min.js"></script>
		<script src="/ddEle/Public/assets/js/flot/jquery.flot.min.js"></script>
		<script src="/ddEle/Public/assets/js/flot/jquery.flot.pie.min.js"></script>
		<script src="/ddEle/Public/assets/js/flot/jquery.flot.resize.min.js"></script>

		<!-- ace scripts -->

		<script src="/ddEle/Public/assets/js/ace-elements.min.js"></script>
		<script src="/ddEle/Public/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
			jQuery(function($) {
				$('.easy-pie-chart.percentage').each(function(){
					var $box = $(this).closest('.infobox');
					var barColor = $(this).data('color') || (!$box.hasClass('infobox-dark') ? $box.css('color') : 'rgba(255,255,255,0.95)');
					var trackColor = barColor == 'rgba(255,255,255,0.95)' ? 'rgba(255,255,255,0.25)' : '#E2E2E2';
					var size = parseInt($(this).data('size')) || 50;
					$(this).easyPieChart({
						barColor: barColor,
						trackColor: trackColor,
						scaleColor: false,
						lineCap: 'butt',
						lineWidth: parseInt(size/10),
						animate: /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()) ? false : 1000,
						size: size
					});
				})
			
				$('.sparkline').each(function(){
					var $box = $(this).closest('.infobox');
					var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
					$(this).sparkline('html', {tagValuesAttribute:'data-values', type: 'bar', barColor: barColor , chartRangeMin:$(this).data('min') || 0} );
				});
			
			
			
			
			  var placeholder = $('#piechart-placeholder').css({'width':'90%' , 'min-height':'150px'});
			  var data = [
				{ label: "social networks",  data: 38.7, color: "#68BC31"},
				{ label: "search engines",  data: 24.5, color: "#2091CF"},
				{ label: "ad campaigns",  data: 8.2, color: "#AF4E96"},
				{ label: "direct traffic",  data: 18.6, color: "#DA5430"},
				{ label: "other",  data: 10, color: "#FEE074"}
			  ]
			  function drawPieChart(placeholder, data, position) {
			 	  $.plot(placeholder, data, {
					series: {
						pie: {
							show: true,
							tilt:0.8,
							highlight: {
								opacity: 0.25
							},
							stroke: {
								color: '#fff',
								width: 2
							},
							startAngle: 2
						}
					},
					legend: {
						show: true,
						position: position || "ne", 
						labelBoxBorderColor: null,
						margin:[-30,15]
					}
					,
					grid: {
						hoverable: true,
						clickable: true
					}
				 })
			 }
			 drawPieChart(placeholder, data);
			
			 /**
			 we saved the drawing function and the data to redraw with different position later when switching to RTL mode dynamically
			 so that's not needed actually.
			 */
			 placeholder.data('chart', data);
			 placeholder.data('draw', drawPieChart);
			
			
			
			  var $tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo('body');
			  var previousPoint = null;
			
			  placeholder.on('plothover', function (event, pos, item) {
				if(item) {
					if (previousPoint != item.seriesIndex) {
						previousPoint = item.seriesIndex;
						var tip = item.series['label'] + " : " + item.series['percent']+'%';
						$tooltip.show().children(0).text(tip);
					}
					$tooltip.css({top:pos.pageY + 10, left:pos.pageX + 10});
				} else {
					$tooltip.hide();
					previousPoint = null;
				}
				
			 });
			
			
			
			
			
			
				var d1 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.5) {
					d1.push([i, Math.sin(i)]);
				}
			
				var d2 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.5) {
					d2.push([i, Math.cos(i)]);
				}
			
				var d3 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.2) {
					d3.push([i, Math.tan(i)]);
				}
				
			
				var sales_charts = $('#sales-charts').css({'width':'100%' , 'height':'220px'});
				$.plot("#sales-charts", [
					{ label: "Domains", data: d1 },
					{ label: "Hosting", data: d2 },
					{ label: "Services", data: d3 }
				], {
					hoverable: true,
					shadowSize: 0,
					series: {
						lines: { show: true },
						points: { show: true }
					},
					xaxis: {
						tickLength: 0
					},
					yaxis: {
						ticks: 10,
						min: -2,
						max: 2,
						tickDecimals: 3
					},
					grid: {
						backgroundColor: { colors: [ "#fff", "#fff" ] },
						borderWidth: 1,
						borderColor:'#555'
					}
				});
			
			
				$('#recent-box [data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('.tab-content')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			
			
				$('.dialogs,.comments').slimScroll({
					height: '300px'
			    });
				
				
				//Android's default browser somehow is confused when tapping on label which will lead to dragging the task
				//so disable dragging when clicking on label
				var agent = navigator.userAgent.toLowerCase();
				if("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
				  $('#tasks').on('touchstart', function(e){
					var li = $(e.target).closest('#tasks li');
					if(li.length == 0)return;
					var label = li.find('label.inline').get(0);
					if(label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation() ;
				});
			
				$('#tasks').sortable({
					opacity:0.8,
					revert:true,
					forceHelperSize:true,
					placeholder: 'draggable-placeholder',
					forcePlaceholderSize:true,
					tolerance:'pointer',
					stop: function( event, ui ) {//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
						$(ui.item).css('z-index', 'auto');
					}
					}
				);
				$('#tasks').disableSelection();
				$('#tasks input:checkbox').removeAttr('checked').on('click', function(){
					if(this.checked) $(this).closest('li').addClass('selected');
					else $(this).closest('li').removeClass('selected');
				});
				
			
			})
		</script>
	<div style="display:none">
		<!--
		<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
		-->
		</div>
		
<script>
    function ajaxGetPropery(cid){
    	$.ajax({
    		url:'<?php echo U("Goods/getidProperty");?>',
				type:'post',
				data:{cid:cid},
				beforeSend:function(){
					$('#loading').show();
				},
				success:function(data){
					$('#loading').hide();
					$('#propertyChBox').html(data);
				},
			async:true,
    	})
    }
    function checkGoodsName(){
    	var pattern = /\S+/ig;
  
    	if(pattern.test($('#goodsname').val())){
    		$('#goodsname').next().hide();
    		return true;
    	}else{
    		$('#goodsname').next().show();
    		return false;
    	}
    }

     function checkStore(target){
    	var pattern = /^[1-9]\d*$|0/ig;
    	if(pattern.test(target.val())){
    		target.next().hide();
    		return true;
    	}else{
    		target.next().show();
    		return false;
    	}
    }
    function checkPrice(target){
    	var pattern = /^[1-9]\d*\.?\d{2}$|^[1-9]\d*$/ig;
  
    	if(pattern.test(target.val())){
    		target.next().hide();
    		return true;
    	}else{
    		target.next().show();
    		return false;
    	}
    }
    ajaxGetPropery($('.catSelect').find(':selected').val());
	$('.catSelect').find('option:disabled').css({
		color:'#5286F0'
	})

	$('.catSelect').find('option:not(:disabled)').css({
		color:'blue'
	}).end().change(function(){
		var cid = $(this).find(':selected').val();
		if(confirm('在更换分类之后，你之前的操作将会重置,确认要切换分类吗?')){
			$('#skuTable').html('');
			$.ajax({
				url:'<?php echo U("Goods/getidProperty");?>',
				type:'post',
				data:{cid:cid},
				beforeSend:function(){
					$('#loading').show();
				},
				success:function(data){
					$('#loading').hide();
					$('#propertyChBox').html(data);
				},
				async:true,
			})
		}
	})

	/**
	 * 上传图片之后实时显示上传的图片
	 */
	$('#info_photo').change(function(){
		var reader = new FileReader(),
		file = $(this).get(0).files[0];

		//检测是不是图片类型
		if(!/^image\/.*/ig.test(file.type)){
			$(this).parent().next().show();
		}else{
			$(this).parent().next().hide();
			reader.readAsDataURL(file);
		}

		reader.onload = function(){
			$('#goods_image_tag').attr('src',reader.result);
			
		}
	
	})

	//表单失去焦点的时候验证信息
	$('form').focusout(function(event){
		var ev = window.event || event,
		  target = ev.srcElement || ev.target;

		//如果是商品名称，则弹出相应的提示信息
		if($(target).attr('id')=='goodsname'){
			if(!checkGoodsName()){
				$(target).next().show();
			}else{
				$(target).next().hide();
			}
		}

		//如果是库存，则弹出相应的提示信息
		if($(target).attr('name')=='store'){

			if(!checkStore($(target))){
				$(target).next().show();
			}else{
				$(target).next().hide();
			}
		}

		//如果是价格，则弹出相应的提示信息
		if($(target).attr('name')=='price'){
			if(!checkPrice($(target))){
				$(target).next().show();
			}else{
				$(target).next().hide();
			}
		}

	}).change(function(){
		$('form').triggerHandler('focusout');
	}).click(function(event){
		var ev = window.event || event,
		  target = ev.srcElement || ev.target;
		if($(target).hasClass('cancelBtn')){
			$(target).closest('table').remove();
		}
	}).submit(function(){
		if($('#skuTable').find('.sku_table').length==0){
	    	alert('请填写完整商品信息!');
	    	return false;
	    }
		var a,b,c;
		console.log($('form input[name="store"]'));
		a=checkGoodsName($('#goodsname'));
		b=checkStore($('form input[name="store"]'));
		c=checkPrice($('form input[name="price"]'));
		return a&&b&&c;

	})
	// $('.upload-thumb').click(function(event){
	// 	// event.preventDefault();
	// 	$('#myModal').modal('show').find('img').attr('src',$('#goods_image_tag').attr('src'));
	// })
	// 
	
	//鼠标移上上传按钮之后显示相信的提示信息
	$('.btn-file').popover({
		content:'上传的必须是图片类型,最佳分辨率是800*800',
		title:'提示',
		trigger:'hover'
	});

	//点击生成商品，添加sku
	$('.addSku').click(function(event){
		var th = '',
			val,
			td='',
			index,
			cloneSku,
			proid,
			proid,
			prokey;
		event.preventDefault();

		//先在后面插入table
	    if($('#skuTable').find('.sku_table').length>=1){
	    	alert('一次只能插入一条产品信息!你可以点击取消来重新选择');
	    	return;
	    }
		cloneSku = $('.cloned #sku_table').clone();
		$('#skuTable').append(cloneSku);

		//取得要插入的skutable的位置
		index = $('#skuTable').find('.sku_table').length - 1;
	
		$.each($('.propertyLabel'),function(i){
			th += '<th class="sku-th-index" style="width:80px;font-size:14px;word-break:break-all">'+$(this).html()+'</th>';
		})
		console.log($('#skuTable .sku_table').eq(index).find('thead tr'));
		$(th).prependTo($('#skuTable .sku_table').eq(index).find('thead tr'));

		$.each($('.valDiv'),function(i){
			if($(this).find(':checked').length>0){
				val = $(this).find(':checked').next().html();
				valkey = $(this).find(':checked').attr('_name')+'[]';
				valid = $(this).find(':checked').attr('_value');
				prokey =  $(this).find(':checked').prev().attr('_name')+'[]';
				proid = $(this).find(':checked').prev().attr('_value');
				input = '<input type="hidden" name='+valkey+' value='+valid+'>';
				input += '<input type="hidden" name='+prokey+' value='+proid+'>';
			}else{
				val = '没有选择';
				input = '';
			}
			td += '<td>'+val+input+'</td>';
		})
		console.log(td);
		$(td).prependTo($('#skuTable .sku_table').eq(index).find('tbody tr'));
		$('#skuTable .sku_table').show();
	})

</script>	

</body>
</html>